Skip to content

Added support for server side row model to enable server side row grouping, similar to infinite row model#411

Open
anujdhillxn wants to merge 3 commits intoplotly:mainfrom
anujdhillxn:main
Open

Added support for server side row model to enable server side row grouping, similar to infinite row model#411
anujdhillxn wants to merge 3 commits intoplotly:mainfrom
anujdhillxn:main

Conversation

@anujdhillxn
Copy link

No description provided.

@anujdhillxn
Copy link
Author

Fixes #410

@gvwilson
Copy link
Contributor

Thanks for the PR @anujdhillxn - please edit the description to give us an idea of what problem this solves and how you've gone about tackling it so that I can find a reviewer.

@gvwilson gvwilson added feature something new community community contribution P3 backlog labels Oct 28, 2025
@anujdhillxn anujdhillxn changed the title Enabled server side row model similar to infinite row model Added support for server side row model to enable server side row grouping, similar to infinite row model Oct 30, 2025
@anujdhillxn
Copy link
Author

Hi @gvwilson. Thanks for the response. I have edited the PR title and the attached issue to be more descriptive.

@BSd3v
Copy link
Collaborator

BSd3v commented Dec 5, 2025

@anujdhillxn,

I am open to this, however, can you provide some more types of tests.

For example, we need to have grouping (this is what you have), filters and sorting, just like how we have it in the infinite model.

We had initially avoided this due to complexity and the logic behind setting it up, also had issues with creating the payload to the dash server for the necessary details.


Also, there is a way to setup the endpoint that has been documented:
https://community.plotly.com/t/serverside-rowmodeltype-with-storing-changes/82787/10?u=jinnyzor

This example demonstrates how to set it up for the grid, my concern with just having the request that you might lose data that is beneficial to the query.

@Adir207
Copy link

Adir207 commented Feb 3, 2026

Hi @anujdhillxn,
Does this makes the usage of serverSide row model similar to the infinite model? Meaning we can utilize the getRowRequest in a callback similarly to what we do for the infinite model? Thanks!

};
}, [getRowsParams.current, customSetProps]);

const getServerSideDatasource = useCallback(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue with getRowsRequest change detection (serverSide model)

In the serverSide row model you do:

customSetProps({
    getRowsRequest: params.request,
});

Dash only triggers callbacks when an Input prop changes (deep equality check).

If the grid is unmounted and later remounted (e.g. inside a modal), the first SSRM request after remount is often identical to the previous one (startRow, endRow, sortModel, etc.). Since we send only params.request, Dash sees it as deep-equal to the previous value and does not trigger the callback.

Result: the grid remains stuck in loading state because no backend getRows callback fires.

This does not occur with the infinite model because it sends a different object shape that typically changes between calls.

Suggested fix

Force the prop to always change, e.g.:

getRows(params) {
    getRowsParams.current = params;

    customSetProps({
        getRowsRequest: {
            ...params.request,
            __dash_ts: Date.now(),  // ensure Dash detects change
        },
    });
}

Optionally also clear props in destroy():

destroy() {
    getRowsParams.current = null;
    customSetProps({
        getRowsRequest: null,
        getRowsResponse: null,
    });
}

This prevents equality-based suppression of the Dash callback and avoids the stuck loading issue after remount.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community community contribution feature something new P3 backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants